/*
 * @Description: 基本数据
 * @Author: Zzt
 * @Date: 2022-11-17 15:50:14
 * @LastEditTime: 2022-12-19 18:06:28
 */
import { realNum } from '@/api/statistics/basicStatistics';
import { Col, Row } from 'antd';
import classNames from 'classnames/bind';
import { useEffect, useState } from 'react';
import styles from '../styles/pieAndIcon.module.scss';
import TagData from './TagData';

const cx = classNames.bind(styles);

const BasicNum = () => {
  const [baseRealNum, setBaseRealNum] = useState<any>({});
  useEffect(() => {
    realNum().then((res) => {
      const { data } = res;
      setBaseRealNum(data);
    });
  }, []);
  return (
    <>
      <Row gutter={[16, 16]}>
        <Col span={6}>
          <TagData title="项目总数" data={193847} unit="个" />
        </Col>
        <Col span={6}>
          <TagData title="案卷总数" data={baseRealNum.folderCounts} unit="卷" />
        </Col>{' '}
        <Col span={6}>
          <TagData title="文件总数" data={baseRealNum.fileCounts} unit="件" />
        </Col>{' '}
        <Col span={6}>
          <TagData title="电子文件总量" data={baseRealNum.eFileCounts} unit="个" />
        </Col>{' '}
        <Col span={6}>
          <TagData title="盒数" data={baseRealNum.boxCounts} unit="盒" />
        </Col>{' '}
        <Col span={6}>
          <TagData title="排架总长" data={baseRealNum.boxTotalWidth} unit="米" />
        </Col>{' '}
        <Col span={6}>
          <TagData title="利用申请" data={17} unit="人次" />
        </Col>{' '}
        <Col span={6}>
          <TagData title="累计借阅" data={12338474} unit="人次" />
        </Col>
      </Row>
    </>
  );
};
export default BasicNum;
